package cn.ipenta.app.controller;

import cn.ipenta.app.service.VaccineService;
import cn.ipenta.core.ResultMapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @author ipenta
 * @ClassName: dd
 * @Description: TODO
 * @date 2017-09-21 下午8:30
 */
@Api("疫苗查询")
@Controller
@RequestMapping("/api/v1/vaccine")
public class VaccineQueryController {

	@Autowired
	VaccineService vaccineService;

	@ApiOperation(value = "查询接口：疫苗记录", notes = "疫苗订单查询", produces = "application/json")
	@GetMapping("/vaccine")
	@ResponseBody
	@ApiImplicitParams(value = {
			@ApiImplicitParam(paramType = "query", name = "vaccineId", required = true, dataType = "String", value = "疫苗 ID")
	})
	public Map<String, Object> query(@RequestParam String vaccineId) {

		return ResultMapper.success(vaccineService.findRecord(vaccineId));
	}


}
